﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace n_
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("enter a number");
            int a = Convert.ToInt32(Console.ReadLine());
            int n = 1;
            while (a != 0)
            {
                n *= a--;
            }
            Console.WriteLine(n);
            Console.ReadKey();

            //second variant
            //Console.WriteLine("enter a number");
            //int a = Convert.ToInt32(Console.ReadLine());
            //int n = 1;
            //for (int i = 0; a > 0; a--)
            //{
            // n*=a;
            //}            
            //Console.WriteLine(n);
            //Console.ReadKey();
        }
    }
}
